<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //编写一个函数，计算两个数字的和、积 要求：使用传参的形式 function test(a,b,type){}
        function num(a, b, c) {
            switch (c) {
                case "+":
                    and = a + b;
                    return and;
                    break;
                case "*":
                    fuc = a * b;
                    return fuc;
                    break;
                default:
                    document.write("不好意思，超出范围了！");
            }
        }
        var a = +prompt("请输入一个数字：");
        var c = prompt("请输入：");
        var b = +prompt("请输入一个数字：");
        // var d = calculate(a,b,c);
        // document.write("结果是"+d);
    </script>
</body>

</html>